
    Reflector.implement
    (
    
        function getPropertyName (value) 
        {
            for (var accessor in this.subject) 
            {
                if (value === this.subject[accessor])
                    return accessor;
            }
            
            throw new ReferenceError('Could not reflect property name');
        }
        
    ,   function getMethods ()
        {
            this.reflect();
            return this.methods;
        }
        
    ,   function getFields ()
        {
            this.reflect();
            return this.fields;
        }
        
    ,   function getPrototype () 
        {
            
        }
        
    ,   function getConstructor ()
        {
            this.reflect();
            return this.ctor;
        }
        
    ,   function reflect () 
        {
            if (this.reflected)
                return;
            
            var subject= this.subject
            ,   member
            ,   fields
            ,   methods
            ,   ctor
            ,   prototype
                
            for (var accessor in subject) 
            {
                member= subject[accessor];
                if ('constructor' === accessor)
                    ctor= new Constructor(member, subject, accessor);
                
                if ('function' === typeof subject[accessor]) 
                {
                    
                }
            }
            
            
            
        }
    );
    
    function Reflector (subject) 
    {
        this.subject= subject;
    };
    
    
    Member.implement
    (
        
        {
            getName: function () 
            {
                return this.name
            }
            
        ,   getImplementation: function () 
            {
                return this.subject;
            }
            
        ,   getOwner: function () 
            {
                return this.owner;
            }
            
        ,   isInherited: function () 
            {
                
            }
            
        ,   isDeclared: function () 
            {
                
            }
            
        ,   isPrivate: function () 
            {
                return /^_/.test(this.name);
            }
            
        ,   isStatic: function () 
            {
                
            }
        }
    );
    
    Method.inherit(Member);
    Method.implement
    (
    
        function isNiladic () 
        {
            return 0 === this.arity;
        }
        
    ,   function isMonadic ()
        {
            return 1 === this.arity
        }    
        
    ,   function isDyadic () 
        {
            return 2 === this.arity;
        }
        
    ,   function isConstructor () 
        {
            return this.name.charAt(0).isUpperCase();
        }
        
    ,   function isSetter () 
        {
            return this.name.beginsWith('set');
        }
    
    ,   function isGetter ()
        {
            return this.name.beginsWith('get');
        }
        
    ,   function isAnonymous () 
        {
            return 'anonymous' === this.name;
        }        
        
    ,   function getArity () 
        {
            return this.arity;   
        }
        
    ,   function call (scope) 
        {
            return this.invokeArgs(scope, [].slice.call(arguments, 1));
        }
        
    ,   function apply (scope, args) 
        {
            return this.subject.apply(scope, args);
        }
    );
    
    
    function Method (value, name, owner)
    {
        Member.call(this, value, name, owner);
    };
    
    
    Constructor.inherit(Method);
    Constructor.implement
    (
        
        {
            construct: function () 
            {
                return this.constructArgs(arguments);
            }
            
        ,   constructArgs: function (args) 
            {
                if (this.isNiladic())
                    return new this.subject;
                
                var Intermediary= this.getIntermediary()
                ,   instance;
                    
                instance= new Intermediary;
                this.subject.apply(instance, args);
                return instance;
            }
            
        ,   getIntermediary: function () 
            {
                if (null == this.Intermediary) 
                {
                    var Parent= this.subject;

                    function Intermediary () {;};
                    Intermediary.inherit(Parent);
                    Intermediary.prototype.constructor= Parent;
                    Intermediary.prototype.parent= Parent.prototype.parent;   
                    
                    this.Intermediary= Intermediary; 
                }
                
                return this.Intermediary;
            }
        }
    
    
    );
    
    function Constructor () 
    {
        
    };
    
    
    Prototype.inherit(PropertyOwner);
    Prototype.implement
    (
    
    
    );
    
    function Prototype (Constructor) 
    {
        
    };
    
    /*
     * A Field is a non-executable member of a class
     */
    Field.inherit(Member);
    Field.implement
    (
    
        function getValue (scope) 
        {
            return scope[this.name];
        }
        
    ,   function setValue (scope, value) 
        {
            scope[this.name]= value
        }
    );
    
    function Field (value, name, owner) 
    {
        
    }
    
    
    Class.implement
    (
        {
            method: function () 
            {
                
            }
        }
    );
    
    function Class () {;};
    
    
    var instance= new Class
    ,   reflector= new Reflector(instance)
    
    alert(reflector.getPropertyName(instance.method));
    
    
    
